<%
Class System__Action
	sub initialize
		if is_empty( C_("SHOW_PAGE_TRACE") ) then
			echo "非法操作"
			response.end
		end if
		call C_( Array( "SHOW_PAGE_TRACE" , 0 ) )
		call C_( Array( "APP_DEBUG" , 0 ) )
	end sub

	sub index
		echo "欢迎使用POPASP控制台"
	end sub
	
	sub readPOPASPClass
		dim sClass,dict,cnt,str
		sClass = that.get("class")
		sClass = "POPASP_" & POP_MVC.ltrim(sClass,"POPASP_")
		set dict = P_("POPASP_REJECTION").Parse( sClass )
		str = ""
		cnt = POP_MVC.count( dict("public_vars") )
		str = str & "公有属性 (" & cnt & ") 个 : " & join( dict("public_vars").items , " , " )  & "<br />" & chr(13) & chr(10) & "<br />" & chr(13) & chr(10)
		
		cnt = POP_MVC.count( dict("public_method") )
		str = str & "公有方法 (" & cnt & ") 个 : " & join( dict("public_method").items , " , " ) & "<br />" & chr(13) & chr(10) & "<br />" & chr(13) & chr(10)
		
		cnt = POP_MVC.count( dict("private_vars") )
		str = str & "私有属性 (" & cnt & ") 个 : " & join( dict("private_vars").items , " , " ) & "<br />" & chr(13) & chr(10) & "<br />" & chr(13) & chr(10)
		
		cnt = POP_MVC.count( dict("private_method") )
		str = str & "私有方法 (" & cnt & ") 个 : " & join( dict("private_method").items , " , " )
		
		Response.write str
	end sub
	
	'删除模板的解析文件
	sub removeCompileFile
		dim compile_file,tpl
		tpl = that.get("controller") & "/" & that.get("action")
		compile_file = that.template.get_compile_file( tpl )
		if POP_MVC.file.isFile( compile_file ) Then
			call that.template.remove_compile( tpl )
			echo "成功删除模板文件(" & tpl & ")对应的解析文件" & POP_MVC.realpath( compile_file )
		else
			echo "模板文件(" & tpl & ")对应的解析文件""" & POP_MVC.realpath( compile_file ) & """不存在"
		end if
	end sub
	
	'删除解析文件所在目录
	sub clearCompileDir
		call that.template.clear_compile
		echo "成功删除""" & that.template.compile_dir & """目录下的所有解析文件"
	end sub
	
	'删除文件
	sub removeFile
		dim file
		file = that.get("file")
		if POP_MVC.file.isFile( file ) Then
			call POP_MVC.file.remove( file )
			echo "成功删除文件""" & POP_MVC.realpath( file ) & """"
		else
			echo "文件""" & POP_MVC.realpath( file ) & """不存在"
		end if
	end sub
	
	'删除文件夹
	sub removeFolder
		dim folder
		folder = that.get("folder")
		if POP_MVC.file.isFolder( folder ) Then
			call POP_MVC.file.remove( folder )
			echo "成功删除文件夹""" & POP_MVC.realpath( folder ) & """"
		else
			echo "文件夹""" & POP_MVC.realpath( folder ) & """不存在"
		end if
	end sub
	
	'读取文件内容
	sub readFile
		dim file,content
		file = that.get("file")
		content = POP_MVC.file_get_contents( file )
		echo content
	end sub
	
	'读session
	sub readSession
		echo session( that.get("key") )
	end sub
	
	'删除session中的一项键值
	sub removeSession
		Session.Contents.Remove( that.get("key") )
		echo "成功删除session("""& that.get("key") & """)"
	end sub
	

	
	private sub echo( arg )
		Response.write arg
	end sub
End Class
%>